/**
 * tjftp -- A simple FTP server, using the ANSI C
 * Copyright (C) 2011  degui.chen <degui.chen@qq.com>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#include "plug_filter.h"
#include "../lib/unity.h"

void tj_plug_filter_init(PSettings settings, int socket_fd) {
}

void tj_plug_filter_destory() {
}

void tj_plug_filter_loop_pre() {
}
void tj_plug_filter_loop_post() {
}

//这里对用户进行验证，如果通过，则返回 0 , 不通过，则返回 -1
int tj_plug_filter_connection(int accept_fd) {
	char info[] = "220 Tarside Jopi FTP Server v1.0 for Linux Socket ready...\r\n";
	send(accept_fd, info, strlen(info) + 1, 0);
	return 0;
}
void tj_plug_filter_disconnect(int accept_fd) {
}

void tj_plug_filter_receive(char* buffer_recv) {
}
void tj_plug_filter_send(char* buffer_recv) {
	tj_string_trim(buffer_recv);
	sprintf(buffer_recv, "%s\r\n", buffer_recv);
}
